<!-- 相当于给模板定义一个名字 define end 成对出现-->
{{ define "public/page_header.html" }}

<div class="header">
  <div class="main">
    <a class="logo" href="/" title=""></a>

    <div class="nav">
	  {{if eq .username  ""}}
		  <a href="/login">登入</a>
		  <a href="/reg">注册</a>	  
	  {{else}}
		  <a href="javascript:void(0);">{{ .username }}</a>
		  <a href="/admin/article/add">发布博客</a>
		  <a href="/admin/article/list?v=2">博文编辑</a>
	  {{end}}
    </div>

    <div class="nav-user ">
      <form class="layui-form fly-article-search" action="/search" method="get">
        <div class="layui-input-inline">
          <div class="layui-input-inline">
            <input type="text" name="key" required lay-verify="required" placeholder="搜索···" autocomplete="off" class="layui-input" />
          </div>
          <!--<div class="layui-input-inline">
            <button class="layui-btn layui-btn-normal layui-icon" lay-submit>&#xe615;</button>
          </div>-->
        </div>
      </form>
      <!-- 未登入状态 -->
    

      <!-- 登入后的状态 -->
      <!--<a class="avatar" href="user.html">
        <img src="http://tp4.sinaimg.cn/1345566427/180/5730976522/0">
        <cite>贤心</cite>
        <i>VIP2</i>
      </a>-->
    </div>
  </div>
</div>
{{end}}